﻿using Abp.Domian.UserInfo;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Abp.EntityFrameworkCore
{
    /// <summary>
    /// 数据库上下文
    /// </summary>
    [ConnectionStringName("Default")]
    public class DbContext : AbpDbContext<DbContext>
    {
        public DbSet<Users> Users { get; set; }

        /// <summary>
        /// AbpDbContext构造函数需要一个参数 
        /// 从当前子类传入赋给父类这个参数 关键字base
        /// </summary>
        /// <param name="options"></param>
        public DbContext(DbContextOptions<DbContext> options) : base(options)
        {
        }

        /// <summary>
        /// 创建模块映射
        /// </summary>
        /// <param name="modelBuilder"></param>
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
    }
}
